import fs from 'fs';
import path from 'path';

/**
 * 初始化上传目录结构
 */
const uploadDirs = [
  path.join(__dirname, '../uploads'),
  path.join(__dirname, '../uploads/dishes'),
];

console.log('📁 开始初始化上传目录...\n');

uploadDirs.forEach((dir) => {
  if (!fs.existsSync(dir)) {
    fs.mkdirSync(dir, { recursive: true });
    console.log(`✅ 创建目录: ${dir}`);
  } else {
    console.log(`ℹ️  目录已存在: ${dir}`);
  }
});

console.log('\n✅ 上传目录初始化完成！');
